 // 时间格式转换
 export const dateFormat = function (date) {
    if (date === undefined) {
        return ''
    }
    var dateTmp = new Date(date)
    var year = dateTmp.getFullYear()
    var month = dateTmp.getMonth() + 1
    var day = dateTmp.getDate()
    var hours = dateTmp.getHours()
    var minutes = dateTmp.getMinutes()
    var seconds = dateTmp.getSeconds()
    if (month < 10) {
        month = '0' + month
    }
    if (day < 10) {
        day = '0' + day
    }
    if (hours < 10) {
        hours = '0' + hours
    }
    if (minutes < 10) {
        minutes = '0' + minutes
    }
    if (seconds < 10) {
        seconds = '0' + seconds
    }
    return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
}

export const dateFormatDate = function (date) {
    if (date === undefined) {
        return ''
    }
    let time = date.replace(/-/g,'/')
    var dateTmp = new Date(time)
    var year = dateTmp.getFullYear()
    var month = dateTmp.getMonth() + 1
    var day = dateTmp.getDate()
    var hours = dateTmp.getHours()
    var minutes = dateTmp.getMinutes()
    var seconds = dateTmp.getSeconds()
    if (month < 10) {
        month = '0' + month
    }
    if (day < 10) {
        day = '0' + day
    }
    if (hours < 10) {
        hours = '0' + hours
    }
    if (minutes < 10) {
        minutes = '0' + minutes
    }
    if (seconds < 10) {
        seconds = '0' + seconds
    }
    return year + '-' + month + '月' + day +'日'
}
